#include "PropertyPaneWidget.h"

#include "core/AppContext.h"
#include "core/AppSignals.h"
#include "models/ProjectDocument.h"

PropertyPaneWidget::PropertyPaneWidget(QWidget* parent)
    : QWidget(parent)
{
    this->setupUi();
}

void PropertyPaneWidget::setupUi()
{
    setupMain();
    setupBrowser();
    setupAppSignals();
    onProjectLoaded();
}

void PropertyPaneWidget::setupMain()
{
    layoutMain = new QGridLayout(this);
    layoutMain->setContentsMargins(0, 0, 0, 0);
    layoutMain->setSpacing(2);
}

void PropertyPaneWidget::setupBrowser()
{
    propertyBrowser_ = new QtTreePropertyBrowser(this);
    layoutMain->addWidget(propertyBrowser_, 0, 0, 1, 1);
}

void PropertyPaneWidget::setupAppSignals()
{
    connect(
        appSignals, &AppSignals::onProjectLoaded, this,
        &PropertyPaneWidget::onProjectLoaded
    );
}

void PropertyPaneWidget::onProjectLoaded() {}
